home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / utilit~1 / xxxx_it.lzh / XXXX_IT.S < prev    next >
Encoding:
Text File  |  1992-10-29  |  4.1 KB  |  219 lines

  1. ;-----------------------------------------------------------------------;
  2. ;        Mint_it/Mac_it - Spectre/MiNT booter            ;
  3. ;        by Sean Gordon and Karl Anders Øygard            ;
  4. ;-----------------------------------------------------------------------;
  5.  
  6. ;spectre                ; Unquote for spectre version
  7.  
  8. esc    EQU $1B
  9.  
  10.     movea.l    sp,a5
  11.     movea.l    4(a5),a5
  12.     move.l    $0C(a5),d0        ; Text size
  13.     add.l    $14(a5),d0        ; Data size
  14.     addi.l    #$0500,d0
  15.     move.l    d0,d1
  16.     add.l    a5,d1
  17.     andi.l    #$FFFFFFFE,d1
  18.     movea.l    d1,sp
  19.  
  20.     move.l    d0,-(sp)
  21.     move.l    a5,-(sp)
  22.     clr.w    -(sp)
  23.     move.w    #$4A,-(sp)
  24.     trap    #1            ; Shrink memory
  25.     lea    12(sp),sp
  26.  
  27.     pea    title(pc)
  28.     move.w    #9,-(sp)
  29.     trap    #1            ; Write message
  30.     addq.w    #6,sp
  31.  
  32.     move.w    #1,-(sp)
  33.     move.w    #14,-(sp)
  34.     trap    #14            ; Get ptr to kbd buffer record
  35.     addq.w    #4,sp
  36.     movea.l d0,a1
  37.     movea.l (a1),a0         ; Get ptr to kbd buffer
  38.     adda.w    6(a1),a0        ; Add head index
  39.     move.w    2(a0),d4        ; Read key
  40.     beq    nochar
  41.     IFD spectre
  42.     cmp.w    #'s',d4            ; Is it the hotkey?
  43.     ELSE
  44.     cmp.w    #'m',d4            ; Is it the hotkey?
  45.     ENDC
  46.     bne    nochar
  47.  
  48.     clr.w    -(sp)
  49.     pea    config(pc)
  50.     move.w    #$3D,-(sp)
  51.     trap    #1            ; Open file
  52.     addq.l    #8,sp
  53.     tst.w    d0
  54.     bmi    nocnf            ; Error?
  55.     move.w    d0,handle
  56.  
  57.     pea    buffer(pc)
  58.     pea    255.w
  59.     move.w    handle(pc),-(sp)
  60.     move.w    #$3F,-(sp)
  61.     trap    #1            ; Read 255 bytes from file
  62.     lea    12(sp),sp
  63.  
  64.     move.w    handle(pc),-(sp)
  65.     move.w    #$3E,-(sp)
  66.     trap    #1            ; Close file
  67.     addq.w    #4,sp
  68.  
  69.     lea    buffer(pc),a0
  70.     lea    path(pc),a1
  71. ploop    cmpi.b    #$0D,(a0)
  72.     beq.s    mv_name
  73.     move.b    (a0)+,(a1)+
  74.     bra.s    ploop
  75.  
  76. mv_name    clr.b    (a1)
  77.     addq.w    #2,a0
  78.     lea    name(pc),a1
  79. nloop    tst.b    (a0)
  80.     beq.s    no_more
  81.     cmpi.b    #$0D,(a0)
  82.     beq.s    no_more
  83.     move.b    (a0)+,(a1)+
  84.     bra.s    nloop
  85.  
  86. no_more    clr.b    (a1)
  87.  
  88.     move.w    #4,-(sp)
  89.     trap    #14            ; Get resolution
  90.     addq.w    #2,sp
  91.     tst.w    d0
  92.     bne.s    notlow            ; Is it low res?
  93.  
  94.     move.w    #1,-(sp)
  95.     pea    -1.w
  96.     pea    -1.w
  97.     move.w    #5,-(sp)
  98.     trap    #14            ; Set medium resolution
  99.     lea    12(sp),sp
  100.  
  101. notlow    pea    bootmsg(pc)
  102.     move.w    #9,-(sp)
  103.     trap    #1            ; Write 'bootmsg'-message
  104.     addq.w    #6,sp
  105.  
  106.     lea    path(pc),a3
  107.     addq.w    #1,a3
  108. nocol    move.b    (a3)+,d0
  109.     beq.s    nodrv
  110.     cmp.b    #':',d0
  111.     bne.s    nocol
  112.     move.b    -2(a3),d0
  113.     and.w    #$00df,d0
  114.     sub.w    #'A',d0
  115.     move.w    d0,-(sp)
  116.     move.w    #14,-(sp)
  117.     trap    #1            ; Set default drive
  118.     addq.w    #4,sp
  119.  
  120.     pea    (a3)
  121.     move.w    #$3B,-(sp)
  122.     trap    #1            ; Change directory
  123.     addq.w    #6,sp
  124.     bra.s    okaydir
  125.  
  126. nodrv    pea    path(pc)
  127.     move.w    #$3B,-(sp)
  128.     trap    #1            ; Change directory
  129.     addq.w    #6,sp
  130.  
  131. okaydir    pea    palette(pc)
  132.     move.w    #6,-(sp)
  133.     trap    #14            ; Set reasonable palette
  134.     addq.w    #6,sp
  135.  
  136.     pea    env(pc)
  137.     pea    com(pc)
  138.     pea    name(pc)
  139.     clr.w    -(sp)
  140.     move.w    #$4B,-(sp)
  141.     trap    #1            ; Execute program
  142.     lea    16(sp),sp
  143.  
  144.     pea    nofile1(pc)
  145.     move.w    #9,-(sp)
  146.     trap    #1            ; 'Can't find...'
  147.     addq.w    #6,sp
  148.  
  149.     pea    path(pc)
  150.     move.w    #9,-(sp)
  151.     trap    #1            ; Write pathname
  152.     addq.w    #6,sp
  153.  
  154.     pea    name(pc)
  155.     move.w    #9,-(sp)
  156.     trap    #1            ; Write filename
  157.     addq.w    #6,sp
  158.  
  159.     pea    nofile2(pc)
  160.     move.w    #9,-(sp)
  161.     trap    #1            ; '- abort'
  162.     addq.w    #6,sp
  163.  
  164. wait    pea    presany(pc)
  165.     move.w    #9,-(sp)
  166.     trap    #1            ; 'Press any key...'
  167.     addq.w    #6,sp
  168.  
  169.     move.w    #7,-(sp)
  170.     trap    #1            ; Wait for a key
  171.     addq.w    #2,sp
  172.  
  173. nochar    pea    $4C0000
  174.     trap    #1            ; pterm
  175.  
  176. ;---------------------------------------------- Couldn't find .cnf file --
  177. nocnf    pea    nofile1(pc)
  178.     move.w    #9,-(sp)
  179.     trap    #1            ; 'Can't find...'
  180.     addq.w    #6,sp
  181.  
  182.     pea    config(pc)
  183.     move.w    #9,-(sp)
  184.     trap    #1            ; config file
  185.     addq.w    #6,sp
  186.  
  187.     pea    nofile2(pc)
  188.     move.w    #9,-(sp)
  189.     trap    #1            ; '- abort'
  190.     addq.w    #6,sp
  191.  
  192.     bra.s    wait
  193.  
  194.     IFD spectre
  195. config    DC.B '\mac_it.cnf',0
  196. title    DC.B esc,'p MAC_IT v1.1, 1992 ',esc,'q by WOF Inc and KAØ',$D,$A,$D,$A,0
  197. bootmsg    DC.B esc,'p<<< Executing Spectre >>>',esc,'q',0
  198.     ELSE
  199. config    DC.B '\mint_it.cnf',0
  200. title    DC.B esc,'p MiNT_IT v1.1, 1992 ',esc,'q by WOF Inc and KAØ',$D,$A,$D,$A,0
  201. bootmsg    DC.B esc,'p<<< Executing MiNT >>>',esc,'q',0
  202.     ENDC
  203.  
  204. nofile1    DC.B esc,'pCan''t find ',0
  205. nofile2    DC.B ' - aborting load.',esc,'q',$0D,$0A,0
  206. presany    DC.B 'Any key to continue.',$0D,$0A,$0D,$0A,0
  207. palette    DC.W $777
  208.     DS.W 15
  209.  
  210. path    DS.W 64
  211. name    DS.W 7
  212.  
  213.     SECTION BSS
  214.  
  215. env    DS.B 1
  216. com    DS.B 1
  217. handle    DS.W 1
  218. buffer    DS.W 128
  219.